import { queryOrgItemListService } from '@/api/public';
import { CustomEnum } from '@/utils/getUtils';

// 处理状态枚举
const processStateEnums = new CustomEnum({
  ToProcess: [1, '待处理'],
  UndoProcess: [2, '不处理'],
  ToAudit: [3, '待审核'],
  DoneProcess: [4, '已处理'],
})

export const PROCESS_STATE_OPTIONS = processStateEnums.options // 处理状态下拉集合
export const PROCESS_STATE_VALUES = processStateEnums.values // 处理状态值映射关系

export const FORM_ITEMS = [
  {
    prop: 'recordNo',
    label: '单据号',
    type: 'input'
  },
  {
    prop: 'areaCode',
    label: '业务区域',
    type: 'select',
    clearable: true,
    filterable: true,
    options: []
  },
  {
    prop: 'state',
    label: '处理状态',
    type: 'select',
    clearable: true,
    options: PROCESS_STATE_OPTIONS
  },
  {
    prop: 'authDepartmentNo',
    label: '归属部门',
    type: 'select',
    remote: true,
    remoteMethod: queryOrgItemListService,
    clearable: true,
    paramKey: 'orgName'
  },
  {
    prop: 'recordApproveTime',
    label: '变更日期',
    type: 'datePicker',
    datePickerType: 'date'
  },
]

export const TABLE_COLUMNS = [
  {
    title: '单据号',
    key: 'recordNo'
  },
  {
    title: '变更日期',
    key: 'recordApproveTime'
  },
  {
    title: '业务区域',
    key: 'areaName'
  },
  {
    title: '归属部门',
    key: 'authDepartmentName'
  },
  {
    title: '状态',
    key: 'stateStr'
  },
  {
    title: '发起人',
    key: 'recordPusherName'
  }
]
